﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace DC.DCHierarchy.Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ServiceHost host = new ServiceHost(typeof(DC.DCHierarchy.Demo.Services), new Uri("net.tcp://10.176.12.39:8001/service/")))
            {
                host.Description.Behaviors.Add(new ServiceMetadataBehavior());

                host.AddServiceEndpoint(typeof(DC.DCHierarchy.Demo.IServiceContract), new NetTcpBinding(), "");
                host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexTcpBinding(), "mex");

                host.Open();
                Console.WriteLine("Service started");
                Console.ReadKey();
                host.Close();
            }
        }
    }
}
